package com.bysj.controller;

import com.bysj.entity.Category;
import com.bysj.entity.Topic;
import com.bysj.service.CategoryService;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("category")
public class CategoryController {
    @Autowired
    CategoryService categoryService;
    //查询分类名称
    @RequestMapping("/getCategoryAllName")
    public List<Category> getCategoryAllName(Map map){
        return categoryService.getCategoryAllName(map);
    }
    //查按类别查询贴子
    @RequestMapping("/getTopicByCategoryName")
    public List<Category> getTopicByCategoryName(@Param("categoryname") String categoryname){
        return categoryService.getTopicByCategoryName(categoryname);
    }



}
